﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;

namespace CS.CleverNotes.Entities
{
    public class Todo : IEntityBase
    {
        public Todo()
        {
            DateCreated = DateTime.Now;
            ParentId = null;
            Completed = false;
        }

        public int Id { get; set; }
        public int? ParentId { get; set; }
        public string Title { get; set; }
        public bool Completed { get; set; }
        public int? SortOrder { get; set; }
        public DateTime DateCreated { get; set; }

        [NotMapped]
        public String GroupName {get { return DateCreated.ToShortDateString(); }  }

        public virtual ICollection<Todo> Todos { get; set; }
        
    }
}
